from selenium.webdriver.common.by import By

class LoginPageLocators:
    # 账号
    USERNAME_INPUT = (By.NAME, "loginName")
    # 密码
    PASSWORD_INPUT = (By.NAME, "roncooPwd")
    # 点击登录按钮
    LOGIN_BUTTON = (By.CLASS_NAME, "sub")
    # 获取错误信息
    LOGIN_ERROR = (By.XPATH, "/html/body/div/div[2]/div[1]/form/div[1]")


# 支付产品信息
class PaymentPageLocators:
    # 新增：无数据提示
    NO_DATA_PROMPT = (By.XPATH, "//div[contains(text(), '无数据')]")
    # 新增：查询结果列表项
    RESULT_ITEM = (By.CSS_SELECTOR, "table tbody tr")


    # 点击支付管理
    PAYMENT_MANAGEMENT = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[7]/h2')
    # 点击进入支付产品信息
    PAYMENT_PRODUCT_INFORMATION = (By.CSS_SELECTOR, '#sidebar > div.accordion.dwz-accordion > div:nth-child(8) > ul > li:nth-child(1) > div > a')
    # 添加支付产品
    ADD_PAYMENT_PRODUCT = (By.CLASS_NAME, "add")
    # 输入支付产品编号
    PAYMENT_PRODUCT_CODE = (By.NAME, "productCode")
    # 输入支付产品名称
    PAYMENT_PRODUCT_NAME = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input")
    # 点击提交
    SUBMIT = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div")
    # 点击确定
    CONFIRM = (By.XPATH, "/html/body/div[13]/div[1]/div/div[2]/ul/li/a/span")

    # 点击设置支付方式
    SET_PAYMENT_METHOD = (
    By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[6]/div/a[1]")
    # 点击添加设置支付方式
    ADD_SETTING_PAYMENT_METHOD = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div[2]/div[1]/ul/li[1]/a/span")
    # 选择支付方式
    PAYMENT_METHOD = (By.ID, "payWayCode")
    # 选择支付类型
    PAYMENT_TYPE = (By.ID, "payTypeCode")
    # 输入支付费率
    PAYMENT_RATE = (By.NAME, "payRate")
    # 点击提交按钮
    PAYMENT_SUBMIT = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[2]/ul/li[1]/div/div/button")
    # 点击支付产品信息
    PAYMENT_PRODUCT = (By.XPATH, "/html/body/div[1]/div[2]/div[2]/div[2]/div[8]/ul/li[1]/div/a")
    # # 点击取消
    # CANCEL = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[2]/div/div/button")
    # 支付产品名称输入框查询
    PAYMENT_PRODUCT_NAME_INPUT = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input")
    # 点击查询按钮
    SEARCH = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[2]/div/div/button")


# 用户支付配置
class UserPayMentPageLocators:
    # 点击支付管理
    PAYMENT_MANAGEMENT = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[7]/h2')
    # 点击用户支付配置
    USER_PAYMENT_CONFIGURATION = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[8]/ul/li[2]/div/a')
    # 添加支付配置
    ADD_PAYMENT_CONFIGURATION = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span")
    # 输入用户编号
    USER_CODE = (By.NAME, "user.userNo")
    # 输入用户名
    USER_NAME = (By.NAME, "user.userName")
    # 输入支付产品编号
    PAYMENT_PRODUCT_CODE = (By.NAME, "product.productCode")
    # 输入支付产品名称
    PAYMENT_PRODUCT_NAME = (By.NAME, "product.productName")
    # 下拉收款方式
    COLLECTION_METHOD = (By.ID, "fundIntoType")
    # 输入风险预存期
    RISK_PRE_STORAGE_PERIOD = (By.NAME, "riskDay")
    # 是否自动结算
    IS_AUTO_SETTLEMENT = (By.NAME, "isAutoSett")
    # 安全等级
    SAFE_LEVEL = (By.NAME, "securityRating")
    # IP白名单
    IP_WHITE_LIST = (By.NAME, "merchantServerIp")
    # 点击提交按钮
    SUBMIT = (By.CSS_SELECTOR, "#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(3) > div > form > div.formBar > ul > li:nth-child(1) > div > div > button")
    # 点击确定按钮
    CONFIRM = (By.XPATH, "/html/body/div[13]/div[1]/div/div[2]/ul/li/a/span")
    # 点击取消按钮
    CANCEL = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[2]/div/div/button")
    # 输入用户名
    USER_NAME_INPUT = (By.XPATH, "//*[@id='navTab']/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input")
    # 点击查询按钮
    SEARCH = (By.XPATH, "//*[@id='navTab']/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[3]/div/div/button")
    # 点击绑定出款银行卡
    BIND_WITHDRAWAL_BANK_CARD = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr/td[8]/div/a[1]")
    # 输入用户编号
    USER_CODE_ID = (By.NAME, "userNo")
    # # 输入用户名
    # USER_NAME_NAME = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[2]/dd/input")
    # 选择银行名称
    BANK_NAME = (By.ID, "bankCode")
    # 选择银行账户类型
    BANK_ACCOUNT_TYPE = (By.ID, "bankAccountType")
    # 输入银行开户名
    BANK_ACCOUNT_NAME = (By.NAME, "bankAccountName")
    # 输入银行账号
    BANK_ACCOUNT = (By.NAME, "bankAccountNo")
    # # 选择证件类型
    # IDENTIFICATION_TYPE = (By.NAME, "cardType")
    # 输入证件号码
    IDENTIFICATION_NUMBER = (By.NAME, "cardNo")
    # 输入手机号
    PHONE_NUMBER = (By.NAME, "mobileNo")
    # 输入开户行详细地址
    OPENING_BANK_ADDRESS = (By.NAME, "street")
    # 点击取消按钮
    BANK_SUBMIT = (By.CLASS_NAME, "close")


# 对账差错列表
class ReconciliationErrorPageLocators:
    # 点击对账管理
    RECONCILIATION_MANAGEMENT = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[13]/h2/span')
    # 点击对账差错列表
    RECONCILIATION_ERROR_LIST = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[14]/ul/li[1]/div/a')
    # 点击账单开始时间
    BILL_START_TIME = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/a")
    # 点击确定按钮
    CONFIRM = (By.CLASS_NAME, "okBut")
    # 点击账单结束时间
    BILL_END_TIME = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[2]/a")
    # 点击确定按钮
    CONFIRMA = (By.CLASS_NAME, "okBut")
    # 点击查询按钮
    SEARCH = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[3]/div/div/button")

# 对账批次列表
class ReconciliationBatchPageLocators:
    # 点击对账管理
    RECONCILIATION_MANAGEMENTL = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[13]/h2/span')
    # 点击对账批次列表
    RECONCILIATION_BATCH_LIST = (By.XPATH, '//*[@id="sidebar"]/div[2]/div[14]/ul/li[2]/div/a')
    # 点击账单时间
    BILL_TIME = (By.CLASS_NAME, "inputDateButton")
    # 点击确定按钮
    CONFIRMA = (By.CLASS_NAME, "okBut")
    # 点击查询按钮
    SEARCH = (By.CLASS_NAME, "buttonContent")


# 支付管理删除
class PaymentManagementLocators:
    # 点击进入支付管理
    PAYMENT_MANAGEMENT = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[7]/h2')
    # 点击进入支付产品信息
    PAYMENT_PRODUCT = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[8]/ul/li[1]/div/a')
    # 点击添加支付产品按钮
    ADD_PRODUCT = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span")
    # 输入支付编号
    PRODUCT_CODE = (By.NAME, "productCode")
    # 输入支付名称
    PRODUCT_NAME = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input")
    # 点击提交
    SUBMIT = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button")
    # 点击删除按钮
    DELETE = (By.XPATH, "/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[6]/div/a[3]")
    # 点击确定按钮
    CONFIRM = (By.XPATH, "/html/body/div[13]/div[1]/div/div[2]/ul/li[1]/a/span")